.class public Lcom/hyphenate/chat/adapter/EMACallRtcImpl;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/hyphenate/chat/adapter/EMACallRtcInterface;


# static fields
.field public static final TAG:Ljava/lang/String; = "EMACallRtcImpl"


# instance fields
.field callManager:Lcom/hyphenate/chat/EMCallManager;

.field rtcConnection:Lcom/superrtc/sdk/RtcConnection;


# direct methods
.method constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public answer()V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    invoke-virtual {v0}, Lcom/superrtc/sdk/RtcConnection;->answer()V

    return-void
.end method

.method public createOffer()V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    invoke-virtual {v0}, Lcom/superrtc/sdk/RtcConnection;->createOffer()V

    return-void
.end method

.method public getConnection()Lcom/superrtc/sdk/RtcConnection;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    return-object v0
.end method

.method public getDefaultConfig(I)Ljava/lang/String;
    .locals 1

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    const-string/jumbo v0, "{}"

    return-object v0
.end method

.method public getRtcId()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    invoke-virtual {v0}, Lcom/superrtc/sdk/RtcConnection;->getName()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getRtcReport()Ljava/lang/String;
    .locals 1

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    invoke-virtual {v0}, Lcom/superrtc/sdk/RtcConnection;->getReportString()Ljava/lang/String;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    invoke-virtual {v0}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public getSubConfig()Ljava/lang/String;
    .locals 1

    const-string/jumbo v0, "{}"

    return-object v0
.end method

.method public hangup()V
    .locals 2

    const-string/jumbo v0, "EMACallRtcImpl"

    const-string/jumbo v1, "hangup"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    invoke-virtual {v0}, Lcom/superrtc/sdk/RtcConnection;->hangup()V

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->callManager:Lcom/hyphenate/chat/EMCallManager;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->callManager:Lcom/hyphenate/chat/EMCallManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMCallManager;->clearRtcConnection()V

    :cond_0
    return-void
.end method

.method public setConfigJson(Ljava/lang/String;)V
    .locals 3

    const-string/jumbo v0, "EMACallRtcImpl"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "setConfigJson:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/lang/String;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_0

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    invoke-virtual {v0, p1}, Lcom/superrtc/sdk/RtcConnection;->setConfigure(Ljava/lang/String;)V

    return-void
.end method

.method public setRemoteJson(Ljava/lang/String;)V
    .locals 3

    :try_start_0
    const-string/jumbo v0, "EMACallRtcImpl"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "setRemoteJson:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    new-instance v1, Ljava/lang/String;

    invoke-direct {v1, p1}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Lcom/superrtc/sdk/RtcConnection;->setRemoteJson(Ljava/lang/String;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method public setRtcConnection(Lcom/hyphenate/chat/EMCallManager;Lcom/superrtc/sdk/RtcConnection;)V
    .locals 0

    iput-object p1, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->callManager:Lcom/hyphenate/chat/EMCallManager;

    iput-object p2, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    return-void
.end method

.method public setStatsEnable(Z)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/adapter/EMACallRtcImpl;->rtcConnection:Lcom/superrtc/sdk/RtcConnection;

    invoke-virtual {v0, p1}, Lcom/superrtc/sdk/RtcConnection;->setStatsEnable(Z)V

    return-void
.end method
